package com.liufh.demo;

import com.liufh.service.HelloService;
import com.liufh.service.SonService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author: liufh
 * @create: 2021-12-30 17:55
 */
@Component
public class ConsumerComponent {

    /**
     * 此处必须用spring的注解进行注入，不能使用dubbo的@Reference注解。因为没有使用dubbo的组件扫描！
     */
//    @Reference
    @Autowired
    private HelloService helloService;

    @Autowired
    private SonService sonService;

    public String sayHello(String name) {
        return helloService.sayHello(name);
    }

    public String sonTest() {
        return sonService.sonMethod();
    }

    public String aCallBTest() {
        return helloService.aCallBTest();
    }

}
